package com.github.catvod.spider.merge;

import java.util.Arrays;

final class fd {
  static final int[] V0;
  
  private static final char[] h;
  
  private boolean BQ = false;
  
  B.x F8 = new B.x();
  
  private xb I = xb.h;
  
  private final int[] PD = new int[1];
  
  StringBuilder Qy = new StringBuilder(1024);
  
  private String W = null;
  
  B.d i4 = new B.d();
  
  B.c iU = new B.c();
  
  private final UF j;
  
  private final int[] j5 = new int[2];
  
  B.HA n = new B.HA();
  
  private B oC;
  
  B.j oq;
  
  private final J5 q;
  
  B.qM t = new B.qM();
  
  private StringBuilder u = new StringBuilder(1024);
  
  private String y;
  
  static {
    char[] arrayOfChar = new char[7];
    arrayOfChar[0] = '\t';
    arrayOfChar[1] = '\n';
    arrayOfChar[2] = '\r';
    arrayOfChar[3] = '\f';
    arrayOfChar[4] = ' ';
    arrayOfChar[5] = '<';
    arrayOfChar[6] = '&';
    h = arrayOfChar;
    V0 = new int[] { 
        8364, 129, 8218, 402, 8222, 8230, 8224, 8225, 710, 8240, 
        352, 8249, 338, 141, 381, 143, 144, 8216, 8217, 8220, 
        8221, 8226, 8211, 8212, 732, 8482, 353, 8250, 339, 157, 
        382, 376 };
    Arrays.sort(arrayOfChar);
  }
  
  fd(UF paramUF, J5 paramJ5) {
    this.j = paramUF;
    this.q = paramJ5;
  }
  
  private void j(String paramString) {
    if (this.q.h())
      this.q.add(new lA(this.j.V(), "Invalid character reference: %s", new Object[] { paramString })); 
  }
  
  void BQ() {
    this.iU.t();
  }
  
  void F8(StringBuilder paramStringBuilder) {
    if (this.W == null) {
      this.W = paramStringBuilder.toString();
    } else {
      if (this.u.length() == 0)
        this.u.append(this.W); 
      this.u.append(paramStringBuilder);
    } 
  }
  
  void GM(xb paramxb) {
    if (this.q.h())
      this.q.add(new lA(this.j.V(), "Unexpected character '%s' in input state [%s]", new Object[] { Character.valueOf(this.j.GM()), paramxb })); 
  }
  
  void I() {
    this.i4.t();
    this.i4.q = true;
  }
  
  void PD(xb paramxb) {
    if (this.q.h())
      this.q.add(new lA(this.j.V(), "Unexpectedly reached end of file (EOF) in input state [%s]", new Object[] { paramxb })); 
  }
  
  boolean PU() {
    boolean bool;
    if (this.y != null && this.oq.C4().equalsIgnoreCase(this.y)) {
      bool = true;
    } else {
      bool = false;
    } 
    return bool;
  }
  
  void Qy(char paramChar) {
    if (this.W == null) {
      this.W = String.valueOf(paramChar);
    } else {
      if (this.u.length() == 0)
        this.u.append(this.W); 
      this.u.append(paramChar);
    } 
  }
  
  String V0() {
    return this.y;
  }
  
  B.j W(boolean paramBoolean) {
    B.j j1;
    if (paramBoolean) {
      j1 = this.F8.nf();
    } else {
      j1 = this.t.nf();
    } 
    this.oq = j1;
    return j1;
  }
  
  void h(xb paramxb) {
    this.j.h();
    this.I = paramxb;
  }
  
  void i4() {
    t(this.iU);
  }
  
  void iU() {
    t(this.i4);
  }
  
  void j5(String paramString) {
    if (this.q.h())
      this.q.add(new lA(this.j.V(), paramString)); 
  }
  
  void n(int[] paramArrayOfint) {
    oq(new String(paramArrayOfint, 0, paramArrayOfint.length));
  }
  
  void oC() {
    this.i4.t();
  }
  
  void oq(String paramString) {
    if (this.W == null) {
      this.W = paramString;
    } else {
      if (this.u.length() == 0)
        this.u.append(this.W); 
      this.u.append(paramString);
    } 
  }
  
  int[] q(Character paramCharacter, boolean paramBoolean) {
    if (this.j.PU())
      return null; 
    if (paramCharacter != null && paramCharacter.charValue() == this.j.GM())
      return null; 
    if (this.j.f(h))
      return null; 
    int[] arrayOfInt = this.PD;
    this.j.w4();
    if (this.j.LW("#")) {
      String str1;
      paramBoolean = this.j.Og("X");
      UF uF = this.j;
      if (paramBoolean) {
        str1 = uF.u();
      } else {
        str1 = str1.W();
      } 
      if (str1.length() == 0) {
        j("numeric reference with no numerals");
        this.j.z();
        return null;
      } 
      this.j.H9();
      if (!this.j.LW(";"))
        j("missing semicolon"); 
      if (paramBoolean) {
        i = 16;
      } else {
        i = 10;
      } 
      try {
        i = Integer.valueOf(str1, i).intValue();
      } catch (NumberFormatException numberFormatException) {
        i = -1;
      } 
      if (i == -1 || (i >= 55296 && i <= 57343) || i > 1114111) {
        j("character outside of valid range");
        arrayOfInt[0] = 65533;
        return arrayOfInt;
      } 
      int k = i;
      if (i >= 128) {
        int[] arrayOfInt1 = V0;
        k = i;
        if (i < arrayOfInt1.length + 128) {
          j("character is not a valid unicode code point");
          k = arrayOfInt1[i - 128];
        } 
      } 
      arrayOfInt[0] = k;
      return arrayOfInt;
    } 
    String str = this.j.oq();
    boolean bool = this.j.R(';');
    if (XR.oC(str) || (XR.BQ(str) && bool)) {
      i = 1;
    } else {
      i = 0;
    } 
    if (!i) {
      this.j.z();
      if (bool)
        j("invalid named reference"); 
      return null;
    } 
    if (paramBoolean && (this.j.nf() || this.j.Ig() || this.j.C4(new char[] { '=', '-', '_' }))) {
      this.j.z();
      return null;
    } 
    this.j.H9();
    if (!this.j.LW(";"))
      j("missing semicolon"); 
    int i = XR.q(str, this.j5);
    if (i == 1) {
      arrayOfInt[0] = this.j5[0];
      return arrayOfInt;
    } 
    if (i == 2)
      return this.j5; 
    StringBuilder stringBuilder = new StringBuilder();
    stringBuilder.append("Unexpected characters returned for ");
    stringBuilder.append(str);
    R2.h(stringBuilder.toString());
    return this.j5;
  }
  
  void t(B paramB) {
    R2.V0(this.BQ);
    this.oC = paramB;
    this.BQ = true;
    B.i i = paramB.h;
    if (i == B.i.V0) {
      this.y = ((B.x)paramB).V0;
    } else if (i == B.i.j && ((B.qM)paramB).R()) {
      j5("Attributes incorrectly present on end tag");
    } 
  }
  
  void u() {
    B.n(this.Qy);
  }
  
  void w4(xb paramxb) {
    this.I = paramxb;
  }
  
  void y() {
    this.oq.LW();
    t(this.oq);
  }
  
  B yx() {
    while (!this.BQ)
      this.I.u(this, this.j); 
    StringBuilder stringBuilder = this.u;
    if (stringBuilder.length() != 0) {
      String str1 = stringBuilder.toString();
      stringBuilder.delete(0, stringBuilder.length());
      this.W = null;
      return this.n.i4(str1);
    } 
    String str = this.W;
    if (str != null) {
      B.HA hA = this.n.i4(str);
      this.W = null;
      return hA;
    } 
    this.BQ = false;
    return this.oC;
  }
}


/* Location:              /Users/hetaiyi/Desktop/my/tech/java/study/aa/temp/temp.jar!/com/github/catvod/spider/merge/fd.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       1.1.3
 */